﻿#ifndef FFMPEGDEMO_H
#define FFMPEGDEMO_H

#include <QMainWindow>
#include <QDebug>
#include <QPixmap>
#include <QThread>

extern "C"{
    #include <libavcodec/avcodec.h>
    #include <libavformat/avformat.h>
    #include <libswscale/swscale.h>
    #include <libavdevice/avdevice.h>
    #include <libavformat/version.h>
    #include <libavutil/time.h>
    #include <libavutil/mathematics.h>
    #include <libavutil/imgutils.h>
}


QT_BEGIN_NAMESPACE
namespace Ui { class FFmpegDemo; }
QT_END_NAMESPACE

class FImage : public QThread
{
    Q_OBJECT
public:
    FImage(QObject *parent = nullptr);

protected:
    void run()override;
signals:
    void imageFinshed(QPixmap image);
};

class FFmpegDemo : public QMainWindow
{
    Q_OBJECT

public:
    FFmpegDemo(QWidget *parent = nullptr);
    ~FFmpegDemo();

private slots:
    void imageFinshed(QPixmap image);

private:
    Ui::FFmpegDemo *ui;
};
#endif // FFMPEGDEMO_H
